using System;
using System.Collections.Generic;
using System.Text;
using NHibernate;
using BVMB.DataLayer.BusinessObjects;
using BVMB.DataLayer.Base;

namespace BVMB.DataLayer.ManagerObjects
{
    public partial interface ICtchuyenbayManager : IManagerBase<BVMB.DataLayer.BusinessObjects.Ctchuyenbay, int>
    {
		// Get Methods
		IList<Ctchuyenbay> GetByMaChuyenBay(System.Int32 chuyenBay);
		IList<Ctchuyenbay> GetByMaSanBayTG(System.Int32 sanBay);
    }

    partial class CtchuyenbayManager : ManagerBase<BVMB.DataLayer.BusinessObjects.Ctchuyenbay, int>, ICtchuyenbayManager
    {
		#region Constructors
		
		public CtchuyenbayManager() : base()
        {
        }
        public CtchuyenbayManager(INHibernateSession session) : base(session)
        {
        }
		
		#endregion
		
        #region Get Methods

		
		public IList<Ctchuyenbay> GetByMaChuyenBay(System.Int32 chuyenBay)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(Ctchuyenbay));
			
			
			ICriteria chuyenBayCriteria = criteria.CreateCriteria("ChuyenBay");
            chuyenBayCriteria.Add(NHibernate.Criterion.Expression.Eq("Id", chuyenBay));
			
			return criteria.List<Ctchuyenbay>();
        }
		
		public IList<Ctchuyenbay> GetByMaSanBayTG(System.Int32 sanBay)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(Ctchuyenbay));
			
			
			ICriteria sanBayCriteria = criteria.CreateCriteria("SanBay");
            sanBayCriteria.Add(NHibernate.Criterion.Expression.Eq("Id", sanBay));
			
			return criteria.List<Ctchuyenbay>();
        }
		
		#endregion
    }
}